<include file="header2"/>
<div class="wraper">
    <header class="text-center font-white font-16">
        <div class="back iconfont icon-back"></div>
        公车预约
    </header>
    <div class="contain">
        <volist name="data" id="vo">
            <div class="main">
                <div class="box dashed_line box2">
                    <div class="flex ">
                        <div class="font">学院/部门：</div>
                        <div class="font">{BEESCRM:$vo.user_college}</div>
                    </div>
                    <div class="flex ">
                        <div>使用人姓名：</div>
                        <div>{BEESCRM:$vo.tea_name}</div>
                    </div>
                    <div class="flex ">
                        <div class="font">使用人手机：</div>
                        <div class="font">{BEESCRM:$tel}</div>
                    </div>
                </div>

                <div class="box dashed_line box2">
                    <div class="flex ">
                        <div class="font">上车地点：</div>
                        <div class="font">{BEESCRM:$vo.user_location}</div>
                    </div>
                    <div class="flex ">
                        <div>目的地：</div>
                        <div>{BEESCRM:$vo.user_destinction}</div>
                    </div>
                    <div class="flex ">
                        <div class="font">用车时间：</div>
                        <div class="font">{BEESCRM:$vo.car_start_time||date="Y-m-d H:i",###}</div>
                    </div>
                </div>
                <div class="box dashed_line box2">
                    <div class="circle circle1"></div>
                    <div class="circle circle2"></div>
                    <div class="flex ">
                        <div class="font-gray2">车型</div>
                        <div class="font-gray">{BEESCRM:$types[$vo['car_type']] ? $types[$vo['car_type']] : "未选择"}</div>
                    </div>
                    <div class="flex ">
                        <div class="font-gray2">用车人数</div>
                        <div class="font-gray">{BEESCRM:$vo.people_num}</div>
                    </div>
                    <div class="flex ">
                        <div class="font-gray2">用车数量</div>
                        <div class="font-gray">{BEESCRM:$vo.car_num}</div>
                    </div>
                    <div class="flex ">
                        <div class="font-gray2">用车天数</div>
                        <div class="font-gray">{BEESCRM:$vo.car_time}</div>
                    </div>
                </div>
                <div class="box box2">
                    <div class="circle circle1"></div>
                    <div class="circle circle2"></div>
                    <div class="flex ">
                        <div class="font-gray2">预约人</div>
                        <div class="font-gray">{BEESCRM:$vo.tea_name}</div>
                    </div>
                </div>
                <div class="box box2">
                    <div class="circle circle1"></div>
                    <div class="circle circle2"></div>
                    <div class="flex ">
                        <div class="font-gray2">备注</div>
                        <div class="font-gray">{BEESCRM:$vo.remarks}</div>
                    </div>
                </div>
            </div>
        </volist>
    </div>
    <input type="hidden" id="confId" value="{BEESCRM:$conf_id}">
    <footer class="flex">
        <a href="/base/OfficialCar/nopass/order_id/{BEESCRM:$order_id}/conf_id/{BEESCRM:$conf_id}" class="btn text-center">不通过</a>
        <a type="button" data-order_id="{BEESCRM:$order_id}" class="btn text-center btn_right pass">通过</a>
    </footer>
</div>
<script src="/assets/base/officialcar/js/jquery-2.1.0.min.js"></script>
<script src="/assets/base/repair/js/sweetalert/lib/sweet-alert.min.js"></script>
<script>
    var height=$(window).height();
    var header_height=$('header').outerHeight(true);
    var footer_height=$('footer').outerHeight(true);
    $('.contain').css('height',height-header_height-footer_height);

    $(document).on('click', '.pass', function () {
        var conf_id = $('#confId').val();
        var order_id = $(this).data('order_id');
        fm.confirm('确定通过审核吗',pass);
        function pass(){
            $.ajax({
                url:"/base/OfficialCar/doPass/conf_id/"+conf_id,
                data:{order_id:order_id},
                type:'post',
                dataType:'json',
                success:function(result){
                    if(result.status == 'F'){
                        fm.alert(result.message);
                    }else if(result.status == 'S'){
                        fm.alert(result.message);
                        setTimeout(reload(),2000);
                    }
                }
            });
        }
    });

    function reload(){
        var conf_id = $('#confId').val();
        window.location.href = "/base/OfficialCar/dispatcher/conf_id/"+conf_id;
    }

</script>
<include file="footer"/>